<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>豆豆笔记</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/css/main.css"/>


    <!--    <link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/dark.css">-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/monokai.min.css">
    <!--    <link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/default.min.css">-->
    <script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script>

    <!-- and it's easy to individually load additional languages -->
    <script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/languages/nginx.min.js"></script>
    <script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/languages/javascript.min.js"></script>
    <style>
        .ws-main {
            border: 0;
        }
    </style>
</head>
<body>
<div class="layui-header ws-header ws-bg-light">
    <div class="layui-container">
        <div class="ws-logo">
            <a class="logo" href="/" style="display: inline;align-items: center;font-size: 30px;">
                <img src="/img/logo.png" alt="豆豆笔记" style="color: #16BAAA;font-size: 30px;width: auto;height: 30px;line-height:60px;margin-right: 10px;">
                <text style="margin-left: 0;">豆豆笔记</text>
            </a>
        </div>
        <div class="ws-header-menu">
            <ul class="layui-nav layui-bg-gray ws-bg-light">
                <li class="layui-nav-item layui-this"><a href="/">首页</a></li>
                <li class="layui-nav-item"><a href="/link/">归档</a></li>
                <li class="layui-nav-item"><a href="/about/">关于</a></li>
                <li class="layui-nav-item"><a href="/tool/">工具</a></li>
                <li class="layui-nav-item"><a href="/sponsor/">赞助</a></li>
            </ul>
            <div class="ws-header-tool ws-bg-light" style="display: inline-block">
                <div class="layui-form" lay-filter="form">
                    <input type="checkbox" name="themeMode" lay-filter="header-theme-mode" lay-skin="switch">
                    <div lay-checkbox>
                        <i class="layui-icon layui-icon-moon"></i> |
                        <i class="layui-icon layui-icon-light"></i>
                    </div>
                </div>
            </div>
        </div>
        <div class="ws-header-menu-btn">
            <a class="ws-menu-phone" href="javascript:;" style="display: block;">
                <i class="ws-header-menu-icon layui-icon layui-icon-shrink-right"></i>
            </a>
        </div>
    </div>
</div>
<div class="ws-menu-phone-list">
    <div style="background-color: inherit;">
        <div style="height: 60px; text-align: right;display: flex;justify-content: space-between">
            <div class="ws-theme-icon-btn" style="border-radius: 7px; display: inline;margin-left: 40px;height: 40px;width: 40px;line-height: 40px;background-color: #d2d2d2;margin-top: 10px;text-align: center;">
                <i class="ws-theme-icon layui-icon layui-icon-moon" style="color: #333333;"></i>
            </div>
            <i class="ws-menu-phone-close layui-icon layui-icon-error" style="color: #333333;line-height: 60px;font-size: 23px"></i>
        </div>
        <ul>
            <li style="border-top: 1px solid #888888;padding: 20px 40px;"><a href="/">首页</a></li>
            <li style="border-top: 1px solid #888888;padding: 20px 40px;"><a href="/link/">归档</a></li>
            <li style="border-top: 1px solid #888888;padding: 20px 40px;"><a href="/about/">关于</a></li>
            <li style="border-top: 1px solid #888888;padding: 20px 40px;"><a href="/tool/">工具</a></li>
            <li style="border-top: 1px solid #888888;padding: 20px 40px;"><a href="/sponsor/">赞助我们</a></li>
        </ul>
    </div>
</div>

<div class="layui-main ws-main ws-bg-light ">
    <div class="layui-padding-3 ws-detail">
        <div class="ws-detail-hd">
            <div class="ws-article-head">
                <h2>利用 frp 实现内网穿透</h2>
            </div>
            <div class="ws-foot">
                <span><i class="layui-icon layui-icon-eye"></i>3289</span>
                <span><i class="layui-icon layui-icon-time"></i>2025-04-25</span>
                <span><i class="layui-icon layui-icon-list"></i>FNOS 飞牛OS frp frpc frps 内网穿透</span>
            </div>
        </div>

        <div class="ws-detail-bd layui-text">

            <h3></h3>
            <h3>资源下载</h3>
            <hr/>
            <blockquote class="layui-elem-quote">
                <div>Windows：<a href="//github.com/fatedier/frp/releases/download/v0.62.0/frp_0.62.0_windows_amd64.zip" target="_blank">frp_0.62.0_windows_amd64.zip</a></div>
                <div>Linux：<a href="//github.com/fatedier/frp/releases/download/v0.62.0/frp_0.62.0_linux_amd64.tar.gz" target="_blank">frp_0.62.0_linux_amd64.tar.gz</a></div>
                <div>或使用命令下载</div>
                <div>
                    <pre>wget https://github.com/fatedier/frp/releases/download/v0.62.0/frp_0.62.0_linux_amd64.tar.gz</pre>
                </div>
            </blockquote>


            <h3>一、服务端（frps）</h3>
            <hr/>
            <div class="layui-collapse">
                <div class="layui-colla-item">
                    <div class="layui-colla-title">通过宝塔面板</div>
                    <div class="layui-colla-content">
                        <ol>
                            <li>通过<code>软件商店</code> 安装 <code>frp管理器</code></li>
                            <li>设置<code>frp管理器</code>，选择frp服务端。</li>
                            <li>选择配置文件，将下面的代码复制进去，并保存。<br>
                                <pre lay-options="{lang:'bash'}">
bindPort = 7100                 # 监听端口
auth.method = "token"
auth.token = "12345678"         # 这个可以理解成连接密码，自己写自己的
kcpBindPort = 15443
webServer.addr = "0.0.0.0"
webServer.port = 7600           # frp面板端口
webServer.user = "admin"        # frp面板账号
webServer.password = "admin"    # frp面板密码
dashboardPwd = "HPHSw8l9oWRnNsOc"
vhostHTTPPort = 8800
vhostHTTPSPort = 18443
log.file = "/var/log/frps.log"
log.level = "info"
log.maxDays = 30

maxPoolCount = 50
tcpmuxHTTPConnectPort  = 16337
</pre>
                            </li>
                            <li>切换到服务状态，重启frp服务</li>
                        </ol>
                    </div>
                </div>
                <div class="layui-colla-item">
                    <div class="layui-colla-title">通过命令行</div>
                    <div class="layui-colla-content">
                        <ol>
                            <li>根据系统下载对应的zip压缩包，下载完成后解压。</li>
                            <li>编辑<code>frps.toml</code></li>
                            <li>将下面的代码复制进去，并保存。<br>
                                <pre lay-options="{lang:'bash'}">
bindPort = 7100                 # 监听端口
auth.method = "token"
auth.token = "12345678"         # 这个可以理解成连接密码，自己写自己的
kcpBindPort = 15443
webServer.addr = "0.0.0.0"
webServer.port = 7600           # frp面板端口
webServer.user = "admin"        # frp面板账号
webServer.password = "admin"    # frp面板密码
dashboardPwd = "HPHSw8l9oWRnNsOc"
vhostHTTPPort = 8800
vhostHTTPSPort = 18443
log.file = "/var/log/frps.log"
log.level = "info"
log.maxDays = 30

maxPoolCount = 50
tcpmuxHTTPConnectPort  = 16337
</pre>
                            </li>
                            <li>执行以下命令<br>
                                <pre lay-options="{lang:'bash'}">
# linux
frps -c frps.toml

# windows
frps.exe -c frps.toml
                </pre>
                            </li>
                        </ol>
                    </div>
                </div>
                <div class="layui-colla-item">
                    <div class="layui-colla-title">验证服务器端frp是否成功启动</div>
                    <div class="layui-colla-content">
                        <ol>
                            <li>打开浏览器地址栏中输入：服务器公网IP:7600 ,进入frp后台管理面板。账号密码都是：admin</li>
                            <li>用户名和密码，以及端口分别对应<code>frps.toml</code>文件中的:<br>
                                <pre lay-options="{lang:'bash'}">webServer.port = 7600  # frp后台管理面板端口
webServer.user = "admin" # frp后台管理面板账号
webServer.password = "admin" # frp后台管理面板密码
                            </pre>
                            </li>
                        </ol>
                    </div>
                </div>
            </div>


            <h3>二、客户端（frpc）</h3>
            <hr/>
            <div class="layui-collapse">
                <div class="layui-colla-item">
                    <div class="layui-colla-title">Windows</div>
                    <div class="layui-colla-content">
                        <ol>
                            <li>编辑<code>frpc.toml</code>这个文件，跟服务器部署文件不一样，注意文件名，不要搞错了</li>
                            <li>把原文件中的内容删除，把以下命令复制进去：<br>
                                <pre lay-options="{lang:'bash'}">
serverAddr = "你阿里云服务器的公网IP" # 服务端ip
serverPort = 7100 # 服务端端口,与服务器配置文件上的端口要一致
auth.method = 'token' # 客户端访问验证方式
auth.token = '12345678' # 客户端访问验证密码，与服务器配置文件上的密码要一致

[[proxies]]
name = "web"
type = "http"
localIP = "127.0.0.1"
localPort = 80
customDomains = ["你阿里云服务器的公网IP"] # 这里也可以是域名，域名需要解析到服务器的IP
                            </pre>
                            </li>
                            <li>粘贴好之后，保存。</li>
                            <li>放行端口“7100、7600、8800”</li>
                            <li>执行命令：<br>
                                <pre lay-options="{lang:'bash'}">frpc.exe -c ./frpc.toml</pre>
                            </li>
                        </ol>
                    </div>
                </div>
                <div class="layui-colla-item">
                    <div class="layui-colla-title">Linux</div>
                    <div class="layui-colla-content">
                        <ol>
                            <li>执行<code>vim frpc.toml</code>命令 编辑<code>frpc.toml</code>这个文件，跟服务器部署文件不一样，注意文件名，不要搞错了</li>
                            <li>把原文件中的内容删除，把以下命令复制进去：<br>
                                <pre lay-options="{lang:'bash'}">
serverAddr = "你阿里云服务器的公网IP" # 服务端ip
serverPort = 7100 # 服务端端口,与服务器配置文件上的端口要一致
auth.method = 'token' # 客户端访问验证方式
auth.token = '12345678' # 客户端访问验证密码，与服务器配置文件上的密码要一致

[[proxies]]
name = "web"
type = "http"
localIP = "127.0.0.1"
localPort = 80
customDomains = ["你阿里云服务器的公网IP"] # 这里也可以是域名，域名需要解析到服务器的IP
                            </pre>
                            </li>
                            <li>按<code>Esc</code>输入<code>:wq</code>保存。</li>
                            <li>放行端口“7100、7600、8800”</li>
                            <li>执行命令：<br>
                                <pre lay-options="{lang:'bash'}">frpc -c ./frpc.toml</pre>
                            </li>
                        </ol>
                    </div>
                </div>
                <div class="layui-colla-item">
                    <div class="layui-colla-title">验证客户端(frpc)是否成功启动</div>
                    <div class="layui-colla-content">
                        使用另一台电脑访问：服务器公网IP:8800,页面出现你部署在本地的网站，表示frpc已启动
                    </div>
                </div>
            </div>
            <p></p>
        </div>
    </div>

</div>

<script type="text/html" id="qrModal">
    <div class="layui-row" style="display: flex; padding:15px;">
        <div class="layui-col-md6" style="flex: 0 0 50%;text-align: center;">
            <img src="/img/wxpay.jpg" class="ws-sponsor-img"/>
        </div>
        <div class="layui-col-md6" style="flex: 0 0 50%;text-align: center;">
            <img src="/img/alipay.jpg" class="ws-sponsor-img"/>
        </div>
    </div>
</script>
<div class="layui-footer ws-footer ws-bg-light">
    <div class="ws-text">
        <div class="ws-footer-menu">
            <div class="ws-footer-menu-type">
                <dl style="flex: 0 0 50%;max-width: 33.33%;width: 100%;">
                    <dt class="ws-bg-light">相关连接</dt>
                    <dd><a class="no-referrer" href="javascript:;" data-title="请作者喝咖啡" data-target="#qrModal">捐赠</a></dd>
                </dl>
                <dl style="flex: 0 0 50%;max-width: 33.33%;width: 100%;">
                    <dt class="ws-bg-light">联系我们</dt>
                    <dd>htct1314@foxmail.com</dd>
                </dl>

            </div>
            <div class="ws-footer-qr-code-list">
                <div class="ws-footer-qr-code">
                    <div style="border: 1px solid #d1d1d1">
                        <img loading="lazy" src="/img/applet.jpg" style="width:100%;max-width: 100%;" alt=""/>
                    </div>
                    <div style="text-align: center">小程序</div>
                </div>
                <div class="ws-footer-qr-code">
                    <div style="border: 1px solid #d1d1d1">
                        <img loading="lazy" src="/img/we_chat.png" style="width:100%;max-width: 120px" alt=""/>
                    </div>
                    <div style="text-align: center">微信</div>
                </div>
                <div class="ws-footer-qr-code">
                    <div style="border: 1px solid #d1d1d1">
                        <img loading="lazy" src="/img/sina.png" style="width:100%;max-width: 120px" alt=""/>
                    </div>
                    <div style="text-align: center">新浪微博</div>
                </div>

            </div>
        </div>
        <hr/>
        <p>友情链接：
            <a href="//www.aliyun.com" target="_blank">阿里云</a>
            <a href="https://www.huaweicloud.com/" target="_blank">华为云</a>
            <a href="//cloud.tencent.com" target="_blank">腾讯云</a>
            <a href="//www.ctyun.cn/" target="_blank">天翼云</a>
            <a href="//layui.dev" target="_blank">Layui</a>
            <a href="//cli.im/" target="_blank">草料网</a>
            <a href="//compresspng.com/zh/" target="_blank">在线压缩图片</a>
            <a href="//www.thinkphp.cn" target="_blank">ThinkPHP</a>
        </p>
        <div class="ws-footer-copyright">
            <div>Copyright © <span id="footer-year"></span> 豆豆笔记 All Rights Reserved.</div>
            <div>豆豆笔记&nbsp;版权所有</div>
            <div>
                <a href="https://beian.miit.gov.cn" target="_blank">
                    <img src="http://htct1314.cn/img/icon.png" style="height:16px;margin-right:5px;" alt/>
                    <span>闽ICP备2022002089号-1</span>
                </a>
            </div>
        </div>
    </div>
</div>

<ul class="layui-fixbar" style="display: none;">
    <li lay-type="top" style="display: list-item;">
        <a href="javascript:;" class="layui-icon layui-icon-top layui-fixbar-top" style="display: block;color:#fff;"></a>
    </li>
</ul>

<script src="/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
</body>
</html>